package com.ewanghuiju.app.ui.resale.adapter;

import android.text.TextUtils;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ewanghuiju.app.R;
import com.ewanghuiju.app.component.ImageLoader;
import com.ewanghuiju.app.model.bean.response.ResaleShopResponBean;
import com.makeramen.roundedimageview.RoundedImageView;

/**
 * @author sj  qq:751943509
 * @class 转售商品列表
 * @time 2020/2/20
 */
public class ResaleShopListAdapter extends BaseQuickAdapter<ResaleShopResponBean, BaseViewHolder> {
    public ResaleShopListAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, ResaleShopResponBean item) {
        helper.setText(R.id.tv_shop_title, TextUtils.isEmpty(item.getGoods_title()) ? "" : item.getGoods_title());
//        helper.setText(R.id.tv_sale, "已兑换" + item.getSales() + "次  剩余" + item.getTotal() + "件");
//        helper.setText(R.id.tv_water_num, "水滴：" + item.getPrice());
        RoundedImageView riv = helper.getView(R.id.riv_item_icon);
        if (!TextUtils.isEmpty(item.getGoods_img())) {
            ImageLoader.load(mContext, item.getGoods_img(), riv);
        }
    }
}
